function [fieldedit]=timeselector(h2,left,top,btnWid,btnHt)

global fieldedit


radbutt(9) = uicontrol('Parent',h2,'Units','normalized','Style', 'radiobutton',...
    'Position',[left top btnWid/4 btnHt/2],...
    'String','[]','TooltipString','Restrict the results to the selected time period',...
    'Callback','load ../tmp/plot_NNK.mat ; param(1) = param(1)*-1 ; save ../tmp/plot_NNK.mat param -append ; disp(''new params saved'')') ;
radbutt(36) = uicontrol('Parent',h2,'Units','normalized','Style', 'radiobutton',...
    'Position',[left+btnWid/4 top btnWid/3 btnHt/2],...
    'String','-][-','TooltipString','Restrict the results to the clusters of this time period linking with the rest',...
    'Callback','load ../tmp/plot_NNK.mat ; param(3) = param(3)*-1 ; save ../tmp/plot_NNK.mat param -append ; disp(''new params saved'')') ;
radbutt(8) = uicontrol('Parent',h2,'Units','normalized','Style', 'radiobutton',...
    'Position',[left+btnWid/4+btnWid/3 top btnWid/3 btnHt/2],...
    'String','[]-[]','TooltipString','Restrict the results to the clusters actives in both time periods',...
    'Callback','load ../tmp/plot_NNK.mat ; param(2) = param(2)*-1 ; save ../tmp/plot_NNK.mat param -append ; disp(''new params saved'')') ;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Premiere limite %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
fieldedit(1) = uicontrol('Parent',h2, ...
    'Units','normalized','BackgroundColor',[1 1 1],'FontSize',11,'ListboxTop',0, ...
    'Position',[left top-btnHt*2.5/3 btnWid btnHt/2], ...
    'String','08/12/20 01:01:00','TooltipString','This is the start time of the first time period',...
    'ForegroundColor','b','Style','edit') ;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
uicontrol('Parent',h2,'Style','pushbutton','Units','normalized', ...
    'Position',[left+3*btnWid/4 top-btnHt/3 btnWid/4 btnHt/3], ...
    'String','>>>>','TooltipString','increase 30.5 days',...
    'Callback','selector plus lesincre(4,:) ');
uicontrol('Parent',h2,'Style','pushbutton','Units','normalized', ...
    'Position',[left+2*btnWid/4 top-btnHt/3 btnWid/4 btnHt/3], ...
    'String','>>>','TooltipString','increase 1 day', ...
    'Callback','selector plus lesincre(3,:) ');
uicontrol('Parent',h2,'Style','pushbutton','Units','normalized', ...
    'Position',[left+btnWid/4 top-btnHt/3 btnWid/4 btnHt/3], ...
    'String','>>','TooltipString','increase 1 hour',...
    'Callback','selector plus lesincre(2,:) ');
uicontrol('Parent',h2, 'Style','pushbutton', 'Units','normalized', ...
    'Position',[left top-btnHt/3 btnWid/4 btnHt/3], ...
    'String','>','TooltipString','increase 1 minute', ...
    'Callback','selector plus lesincre(1,:) ');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
uicontrol('Parent',h2,'Style','pushbutton','Units','normalized', ...
    'Position',[left top-btnHt*3.5/3 btnWid/4 btnHt/3], ...
    'String','<<<<','TooltipString','decrease 30.5 days',...
    'Callback','selector moins lesincre(4,:) ');
uicontrol('Parent',h2,'Style','pushbutton','Units','normalized', ...
    'Position',[left+btnWid/4 top-btnHt*3.5/3 btnWid/4 btnHt/3], ...
    'String','<<<','TooltipString','decrease 1 days', ...
    'Callback','selector moins lesincre(3,:) ');
uicontrol('Parent',h2,'Style','pushbutton','Units','normalized', ...
    'Position',[left+2*btnWid/4 top-btnHt*3.5/3 btnWid/4 btnHt/3], ...
    'String','<<','TooltipString','decrease 1 hour', ...
    'Callback','selector moins lesincre(2,:) ');
uicontrol('Parent',h2,'Style','pushbutton','Units','normalized', ...
    'Position',[left+3*btnWid/4 top-btnHt*3.5/3 btnWid/4 btnHt/3], ...
    'String','<','TooltipString','decrease 1 minute', ...
    'Callback','selector moins lesincre(1,:) ');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Time period %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
fieldedit(3) = uicontrol('Parent',h2,'Units','normalized','BackgroundColor',[1 1 1], ...
    'FontSize',11,'ListboxTop',0, ...
    'Position',[left top-btnHt*5/3 btnWid/2 btnHt/2], ...
    'String','28800','TooltipString','This is the length of both time periods',...
    'ForegroundColor','b','Style','edit') ;
fieldedit(2) = uicontrol('Parent',h2,'Units','normalized', 'Style','popup', ...
    'Position',[left+btnWid/2 top-btnHt*6.8/3 btnWid/2 btnHt],'TooltipString','Units of the time period', ...
    'String','min  |hrs  |day  |month','Tag','incre');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Seconde limite %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
fieldedit(4) = uicontrol('Parent',h2, ...
    'Units','normalized','BackgroundColor',[1 1 1],'FontSize',11, ...
    'ListboxTop',0,'Position',[left top-btnHt*7.5/3 btnWid btnHt/2], ...
    'String','07/01/01 01:01:00','TooltipString','This is the start time of the second time period', ...
    'ForegroundColor','b','Style','edit') ;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
uicontrol('Parent',h2,'Style','pushbutton','Units','normalized', ...
    'Position',[left+3*btnWid/4 top-btnHt*6/3 btnWid/4 btnHt/3], ...
    'String','>>>>','TooltipString','increase 30.5 days', ...
    'Callback','selector plus2 lesincre(4,:) ');
uicontrol('Parent',h2,'Style','pushbutton','Units','normalized', ...
    'Position',[left+2*btnWid/4 top-btnHt*6/3 btnWid/4 btnHt/3], ...
    'String','>>>','TooltipString','increase 1 day', ...
    'Callback','selector plus2 lesincre(3,:) ');
uicontrol('Parent',h2,'Style','pushbutton','Units','normalized', ...
    'Position',[left+btnWid/4 top-btnHt*6/3 btnWid/4 btnHt/3], ...
    'String','>>','TooltipString','increase 1 hour', ...
    'Callback','selector plus2 lesincre(2,:) ');
uicontrol('Parent',h2,'Style','pushbutton','Units','normalized', ...
    'Position',[left top-btnHt*6/3 btnWid/4 btnHt/3], ...
    'String','>','TooltipString','increase 1 minute', ...
    'Callback','selector plus2 lesincre(1,:) ');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
uicontrol('Parent',h2,'Style','pushbutton','Units','normalized', ...
    'Position',[left top-btnHt*8.5/3 btnWid/4 btnHt/3], ...
    'String','<<<<','TooltipString','decrease 30.5 days', ...
    'Callback','selector moins2 lesincre(4,:) ');
uicontrol('Parent',h2,'Style','pushbutton','Units','normalized', ...
    'Position',[left+btnWid/4 top-btnHt*8.5/3 btnWid/4 btnHt/3], ...
    'String','<<<','TooltipString','decrease 1 day', ...
    'Callback','selector moins2 lesincre(3,:) ');
uicontrol('Parent',h2,'Style','pushbutton','Units','normalized', ...
    'Position',[left+2*btnWid/4 top-btnHt*8.5/3 btnWid/4 btnHt/3], ...
    'String','<<','TooltipString','decrease 1 hour', ...
    'Callback','selector moins2 lesincre(2,:) ');
uicontrol('Parent',h2,'Style','pushbutton','Units','normalized', ...
    'Position',[left+3*btnWid/4 top-btnHt*8.5/3 btnWid/4 btnHt/3], ...
    'String','<','TooltipString','decrease 1 minute', ...
    'Callback','selector moins2 lesincre(1,:) ');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Sources infos %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
fieldedit(5) = uicontrol('Parent',h2,'Units','normalized', 'Style','popup', ...
    'Position',[left top-btnHt*12/3 btnWid/2 btnHt],'TooltipString','Hypocenters (ploted as dots with error bars)', ...
    'String','      |1d-raw|1d-xco|1d-NNK|3d-raw|3d-xco|3d-NNK|DD1d1d|DD1d3d|DD3d1d|DD3d3d','Tag','loc1');
fieldedit(6) = uicontrol('Parent',h2,'Units','normalized', 'Style','popup', ...
    'Position',[left+btnWid/2 top-btnHt*12/3 btnWid/2 btnHt],'TooltipString','Second set of hypocenters to compare with the first (same axis dimensions, ploted as dots with displacement vectors)', ...
    'String','      |1d-raw|1d-xco|1d-NNK|3d-raw|3d-xco|3d-NNK|DD1d1d|DD1d3d|DD3d1d|DD3d3d','Tag','loc2');

fieldedit(7) = uicontrol('Parent',h2,'Units','normalized', 'Style','popup', ...
    'Position',[left top-btnHt*13.5/3 btnWid/2 btnHt],'TooltipString','Focal mechanism (ploted as beach balls for DC, squares for CLVD, or circles for isotropic)', ...
    'String','      |FP-*  |FP-DC |FP-CLV|FP-iso|FP-ind','Tag','FP1');
fieldedit(8) = uicontrol('Parent',h2,'Units','normalized', 'Style','popup', ...
    'Position',[left+btnWid/2 top-btnHt*13.5/3 btnWid/2 btnHt],'TooltipString','Second set of focal mechanism to compare with the first (same axis dimensions, ploted as beach balls for DC, squares for CLVD, or circles for isotropic)', ...
    'String','      |FP-*  |FP-DC |FP-CLV|FP-iso|FP-ind','Tag','FP2');

fieldedit(10) = uicontrol('Parent',h2,'Units','normalized', 'Style','popup', ...
    'Position',[left top-btnHt*15/3 btnWid/2 btnHt],'TooltipString','Fault parameters (ploted as line for fault plane, arrow for fault slip)', ...
    'String','      |Fault*|Plane |Slip  ','Tag','F1');
fieldedit(11) = uicontrol('Parent',h2,'Units','normalized', 'Style','popup', ...
    'Position',[left+btnWid/2 top-btnHt*15/3 btnWid/2 btnHt],'TooltipString','Second set of fault parameters to compare with the first (same axis dimensions, ploted as line for fault plane, arrow for fault slip)', ...
    'String','      |Fault*|Plane |Slip  ','Tag','F2');

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Manual axis limites %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
fieldedit(12) = uicontrol('Parent',h2,'Units','normalized','BackgroundColor',[1 1 1], ...
    'FontSize',11,'ListboxTop',0, ...
    'Position',[left top-btnHt*15/3 btnWid/2 btnHt/2], ...
    'String','NaN','TooltipString','This is the minimal longitude',...
    'ForegroundColor','b','Style','edit') ;
fieldedit(13) = uicontrol('Parent',h2,'Units','normalized','BackgroundColor',[1 1 1], ...
    'FontSize',11,'ListboxTop',0, ...
    'Position',[left+btnWid/2 top-btnHt*15/3 btnWid/2 btnHt/2], ...
    'String','NaN','TooltipString','This is the maximal longitude',...
    'ForegroundColor','b','Style','edit') ;

fieldedit(14) = uicontrol('Parent',h2,'Units','normalized','BackgroundColor',[1 1 1], ...
    'FontSize',11,'ListboxTop',0, ...
    'Position',[left top-btnHt*16.5/3 btnWid/2 btnHt/2], ...
    'String','NaN','TooltipString','This is the minimal latitude',...
    'ForegroundColor','b','Style','edit') ;
fieldedit(15) = uicontrol('Parent',h2,'Units','normalized','BackgroundColor',[1 1 1], ...
    'FontSize',11,'ListboxTop',0, ...
    'Position',[left+btnWid/2 top-btnHt*16.5/3 btnWid/2 btnHt/2], ...
    'String','NaN','TooltipString','This is the maximal latitude',...
    'ForegroundColor','b','Style','edit') ;

fieldedit(16) = uicontrol('Parent',h2,'Units','normalized','BackgroundColor',[1 1 1], ...
    'FontSize',11,'ListboxTop',0, ...
    'Position',[left top-btnHt*18/3 btnWid/4 btnHt/2], ...
    'String','NaN','TooltipString','This is the minimal depth [km]',...
    'ForegroundColor','b','Style','edit') ;
fieldedit(17) = uicontrol('Parent',h2,'Units','normalized','BackgroundColor',[1 1 1], ...
    'FontSize',11,'ListboxTop',0, ...
    'Position',[left+btnWid/4 top-btnHt*18/3 btnWid/4 btnHt/2], ...
    'String','NaN','TooltipString','This is the maximal depth [km]',...
    'ForegroundColor','b','Style','edit') ;

uicontrol('Parent',h2,'Style','pushbutton','Units','normalized', ...
    'Position',[left+btnWid/2 top-btnHt*18/3 btnWid/6 btnHt/2], ...
    'String','<=','TooltipString','Get dimensions from current dataset', ...
    'Callback','getlims(1)');
uicontrol('Parent',h2,'Style','pushbutton','Units','normalized', ...
    'Position',[left+4*btnWid/6 top-btnHt*18/3 btnWid/6 btnHt/2], ...
    'String','X','TooltipString','Clear dimensions', ...
    'Callback','getlims(2)');
uicontrol('Parent',h2,'Style','pushbutton','Units','normalized', ...
    'Position',[left+5*btnWid/6 top-btnHt*18/3 btnWid/6 btnHt/2], ...
    'String','?','TooltipString','Clear dimensions', ...
    'Callback','plot_lims');

if exist('../tmp/strings.mat','file') ~= 0
    load ../tmp/strings.mat
    for i=1:length(fieldedit)
        if fieldedit(i) > 0
            set(fieldedit(i),'string',strings{i});
        end
    end
end